﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="edit_room.aspx.cs" Inherits="edit_room" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<div align="center">
    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
        <asp:View ID="View1" runat="server">
        <br /><br /><br />
    <img src="Image/edit-room.png" alt=""/><br /><br />
            
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AllowSorting="True" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" 
                DataKeyNames="ROOM_NO" SelectedIndex="0" ForeColor="#FFCC66" PageSize="20">
                <Columns>
                    <asp:CommandField ShowSelectButton="True">
                    <HeaderStyle BackColor="#4A1106" />
                    </asp:CommandField>
                    <asp:BoundField DataField="ROOM_NO" HeaderText="ROOM_NO" ReadOnly="True" 
                        SortExpression="ROOM_NO" />
                    <asp:BoundField DataField="ROOM_TYPE_NAME" HeaderText="ROOM_TYPE_NAME" 
                        SortExpression="ROOM_TYPE_NAME" />
                    <asp:BoundField DataField="STATUS" HeaderText="STATUS" 
                        SortExpression="STATUS" />
                    <asp:BoundField DataField="GUEST_ID" HeaderText="GUEST_ID" 
                        SortExpression="GUEST_ID" />
                </Columns>
                <HeaderStyle BackColor="#993300" />
                <PagerStyle HorizontalAlign="Center" />
                <RowStyle HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#CC9900" />
            </asp:GridView>
            
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString17 %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString17.ProviderName %>" 
                SelectCommand="SELECT ROOMS.ROOM_NO, ROOM_DETAIL.ROOM_TYPE_NAME, ROOMS.STATUS, ROOMS.GUEST_ID FROM ROOMS INNER JOIN ROOM_DETAIL ON ROOMS.ROOM_TYPE_ID = ROOM_DETAIL.ROOM_TYPE_ID">
            </asp:SqlDataSource>
            <asp:Button ID="Button4" runat="server" BackColor="#FFCC66" 
                onclick="edit_Click" Text="EDIT" BorderColor="#FF9966" />
            &nbsp;&nbsp;
            <asp:Button ID="Button5" runat="server" BackColor="#FFCC66" 
                BorderColor="#FF9966" Height="25px" onclick="Back_Click" Text="&lt;&lt; Back" 
                Width="85px" />
            <br />
            <asp:Label ID="LabelSelected" runat="server" ForeColor="#FFCC66"></asp:Label>

        </asp:View>

        <asp:View ID="View2" runat="server">
        <br /><br /><br />
    <img src="Image/edit-room.png" alt=""/><br /><br />
    <table>
        <tr><td style="color: #FFCC66">ROOM No. : </td>
        <td><asp:TextBox ID="TextBox1" runat="server" BackColor="#FFCC66" Width="190px" 
                    BorderColor="#FF9966"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator5"
                        runat="server" ErrorMessage="*" ControlToValidate="TextBox1" 
                    ForeColor="#FFCC66"></asp:RequiredFieldValidator></td></tr>

        <tr>
            <td style="color: #FFCC66">ROOM TYPE : </td>
            <td>
                <asp:DropDownList ID="DropDownList1" runat="server" BackColor="#FFCC66" 
                    DataSourceID="orclDataSource1" DataTextField="ROOM_TYPE_NAME" 
                    DataValueField="ROOM_TYPE_ID" Width="190px">
                </asp:DropDownList>
               
                <asp:SqlDataSource ID="orclDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString11 %>" 
                    ProviderName="<%$ ConnectionStrings:ConnectionString11.ProviderName %>" 
                    SelectCommand="SELECT ROOM_TYPE_ID, ROOM_TYPE_NAME FROM ROOM_DETAIL">
                </asp:SqlDataSource>
               
            </td>
        </tr>

        <tr>
            <td style="color: #FFCC66">STATUS : </td>
            <td>
                <asp:DropDownList ID="DropDownList2" runat="server" BackColor="#FFCC66" 
                    Width="190px" AutoPostBack="True">
                    <asp:ListItem Value="N" Selected="True">NO</asp:ListItem>
                    <asp:ListItem Value="Y">YES</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>

         <tr><td style="color: #FFCC66">CURRENT GUEST : </td>
        <td>
            <asp:DropDownList ID="DropDownList3" runat="server" 
                DataSourceID="orclDataSource2" DataTextField="GUEST_ID" 
                DataValueField="GUEST_ID" BackColor="#FFCC66" Width="190px">
                <asp:ListItem>- None -</asp:ListItem>
            </asp:DropDownList>
            <asp:SqlDataSource ID="orclDataSource2" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString12 %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString12.ProviderName %>" 
                SelectCommand="SELECT GUEST_ID FROM GUESTS"></asp:SqlDataSource>
        </td></tr>
           

        

         <!--<tr>
            <td></td>
            <td></td>
        </tr>-->

        <tr>
            <td></td>
            <td>
                <asp:Button ID="Button1" runat="server" Text="SAVE" BackColor="#FFCC66" 
                    Height="25px" Width="85px" onclick="Button1_Click" BorderColor="#FF9966" />&nbsp;&nbsp;&nbsp; 
                <asp:Button ID="Button2"
                    runat="server" Text="Cancel" BackColor="#FFCC66" Height="25px" 
                    Width="85px" onclick="Button2_Click" BorderColor="#FF9966" 
                    CausesValidation="False" /></td>
        </tr>

        <tr>
            <td></td>
            <td><asp:Label ID="Label1" runat="server" ForeColor="#FFCC66"></asp:Label></td>
        </tr>

        <tr>
            <td></td>
            <td>
                <asp:Button ID="Button3" runat="server" Text="<< Back" BackColor="#FFCC66" 
                    onclick="Back_Click" Height="25px" Width="85px" BorderColor="#FF9966" 
                    CausesValidation="False" /></td>
        </tr>
        
    </table>

        </asp:View>

    </asp:MultiView>

</div>

</asp:Content>

